#include "head.h"

int epoll_add(int epoll_fd, int fd){
    struct epoll_event event;
    event.data.fd = fd;
    event.events = EPOLLIN;

    int ret = epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd, &event);
    ERROR_CHECK(ret,-1,"epollAddRead in epoll.c");
    // puts("epoll add");
    return 0;
}
int epoll_del(int epoll_fd, int fd){
    struct epoll_event event;
    event.data.fd = fd;
    event.events = EPOLLIN;

    int ret = epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd, &event);
    ERROR_CHECK(ret,-1,"epollDelRead in epoll.c")
    // puts("epoll del");
    return 0;
}